#include <func.h>
void sigfunc(int signum)
{
    printf("before sleep %d is here\n",signum);
    //sleep(3);//观察信号处理函数的打断情况
    //printf("after sleep %d is here\n",signum);
}
int main(int argc,char *argv[])
{
    signal(SIGINT,sigfunc);
    //signal(SIGQUIT,sigfunc);
    char buf[20];
    bzero(buf,sizeof(buf));
    read(STDIN_FILENO,buf,sizeof(buf));
    printf("%s",buf);
    //while(1)//使进程一直处在运行状态，这样才能接收信号
    //    sleep(1);
    return 0;
}

